# https://gitee.com/yueyinqiu5990/tj12413601/blob/master/assignment1/question6/main.py
import torch.fft


def main():
    _ = input()
    f = [float(c) for c in input().split(" ")]
    g = [float(c) for c in input().split(" ")]

    result_length = len(f) + len(g) - 1

    f = torch.tensor(f)
    g = torch.tensor(g)

    f = torch.fft.fft(f, n=result_length)
    g = torch.fft.fft(g, n=result_length)

    y = f * g
    
    y = torch.fft.ifft(y)

    for r in y:
        print(f"{complex(r).real:.0f}", end=' ')


if __name__ == "__main__":
    main()
